package request

import "net/http"

//数据请求类型
type Request struct {
	httpReq *http.Request //http请求
	depth   uint32        // 请求深度
}

//创建一个数据请求实体
func NewReq(httpReq *http.Request, depth uint32) *Request {
	return &Request{httpReq: httpReq, depth: depth}
}

//获取HTTP请求
func (req *Request) GetHttpReq() *http.Request {
	return req.httpReq
}

//获取请求深度
func (req *Request) GetDepth() uint32 {
	return req.depth
}

//请求的有效性
func (req *Request) Valid() bool {
	return req.httpReq != nil && req.httpReq.URL != nil
}
